import request from '@/utils/request'

// 渠道分析/新增用户
export function getSelectChannelNewUserByDate(data) {
  let url = '';
	let baseUrl = `${process.env.VUE_APP_BASE_API}/gmDevice/selectChannelNewUserByDate?startDate=${data.startDate}&endDate=${data.endDate}&appKey=${data.appKey}`;
	url = baseUrl + (data.version ? ('&appVersion=' + data.version) : ('')) + (data.channel ? ('&channel=' + data.channel) : (''))
	return request({
    url,
    method: 'get',
    headers: {
      'Content-Type': 'x-www-form-urlencoded'
    }
  })
}

// 渠道分析/活跃用户
export function getSelectChannelActiveUserByDate(data) {
  let url = '';
	let baseUrl = `${process.env.VUE_APP_BASE_API}/gmDevice/selectChannelActiveUserByDate?startDate=${data.startDate}&endDate=${data.endDate}&appKey=${data.appKey}`;
	url = baseUrl + (data.version ? ('&appVersion=' + data.version) : ('')) + (data.channel ? ('&channel=' + data.channel) : (''))
	return request({
    url,
    method: 'get',
    headers: {
      'Content-Type': 'x-www-form-urlencoded'
    }
  })
}

// 渠道分析/启动次数
export function getSelectChannelOpenCountByDate(data) {
  let url = '';
	let baseUrl = `${process.env.VUE_APP_BASE_API}/gmDevice/selectChannelOpenCountByDate?startDate=${data.startDate}&endDate=${data.endDate}&appKey=${data.appKey}`;
	url = baseUrl + (data.version ? ('&appVersion=' + data.version) : ('')) + (data.channel ? ('&channel=' + data.channel) : (''))
	return request({
    url,
    method: 'get',
    headers: {
      'Content-Type': 'x-www-form-urlencoded'
    }
  })
}